package dao.impl;

import dao.BaseDao.BaseDao;
import javabean.Account;
import javabean.User;

public class AccountDaoImpl extends BaseDao implements AccountDao{
    @Override
    public Account queryAccountByAccountId(Integer accountId) {
        String sql="select `id`,`accountId`,`points`,`ifReserve`,`tableId` from t_user where accountId = ?";
        return queryForOne(Account.class, sql, accountId);
    }

    @Override
    public int saveAccount(Account account) {
        String sql="insert into t_user(`accountId`) values(?)";
        return update(sql,account.getAccountId());
    }

    @Override
    public int deleteAccountByAccountId(Integer accountId) {
        String sql="delete from t_user where accountId = ?";
        return update(sql,accountId);
    }
}
